package com.vdf.sisconsolid.rest.definition;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;

import com.vdf.sisconsolid.controller.AddressController;


@Path("address")
public class RestAddress {
	
	@Context HttpServletRequest request;
	
	@Path("provinces")
	@GET
	@Produces("application/json")
	public Map<String, Object> getProvinces() {
		return AddressController.processGetProvinces();
	}
	
	@Path("cities")
	@GET
	@Produces("application/json")
	public Map<String, Object> getCities(@QueryParam("filter") String filter) {
		return AddressController.processGetCities(filter);
	}

	@Path("neighborhoods")
	@GET
	@Produces("application/json")
	public Map<String, Object> getNeighborhoods(@QueryParam("filter") String filter) {
		return AddressController.processGetNeighborhoods(filter, request);
	}
	
	@Path("streets")
	@GET
	@Produces("application/json")
	public Map<String, Object> getStreets(@QueryParam("filter") String filter) {
		return AddressController.processGetStreets(filter, request);
	}

}
